<template>
    <!-- 功能介绍 -->
    <view class="pages">
        <view class="item w-100" v-for="(item, i) in list" :key="i"
            @click="navigateTo(`/pages-users/tool-about-us/details?id=${item?.id}`)">
            <view class="">
                <view class="co-black f-s-32">{{ item?.title }}</view>
                <view class="mar-t-10 co-99 f-s-28">{{ item?.update_time }}</view>
            </view>
            <u-icon name="arrow-right" color="#999" size="26"></u-icon>
        </view>
    </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { onLoad, onReachBottom } from '@dcloudio/uni-app'
import { showToast, navigateTo, navigateBack } from '@/utils'
import { functionListApi } from '@/services/my/tool-about-us'

const list = ref<any[]>([])
const last_page = ref<number>(0)
const params = ref({
    page: 1,
    limit: 10,
})

onLoad(() => {
    functionList()
})

async function functionList() {
    try {
        const res: any = await functionListApi(params.value)
        list.value = list.value.concat(res.data.data)
        last_page.value = res.data.last_page
        console.log(res)
    } catch (error) {

    }
}

onReachBottom(() => {
    if (params.value.page < last_page.value) {
        params.value.page++
        functionList()
    }

})
</script>

<style lang="scss" scoped>
.pages {
    width: 750rpx;
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 24rpx 80rpx 24rpx;

    .item {
        height: 156rpx;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1rpx solid #E6E6E6;

    }

}
</style>